package com.wind.gtest;

import android.app.Application;
import android.content.res.Resources;
import android.util.DisplayMetrics;

public class GTApplication extends Application {

	private static GTApplication mInstance = null;
	public boolean m_bKeyRight = true;

	@Override
	public void onCreate() {
		super.onCreate();
		mInstance = this;
		DisplayMetrics dm = new DisplayMetrics();
		dm = getResources().getDisplayMetrics();

		SCREEN_WIDTH = dm.widthPixels;
		SCREEN_HEIGHT = dm.heightPixels;
		density = dm.density;
	}

	@Override
	// 建议在您app的退出之前调用mapadpi的destroy()函数，避免重复初始化带来的时间消耗
	public void onTerminate() {
		// TODO Auto-generated method stub
		super.onTerminate();
	}

	public static GTApplication getInstance() {
		return mInstance;
	}


	private static int SCREEN_HEIGHT, SCREEN_WIDTH;
	public static float density;

	public static int getScreenHeight() {
		return SCREEN_HEIGHT;
	}

	public static int getScreenWidth() {
		return SCREEN_WIDTH;
	}

	public static float getDensity() {
		return density;
	}

}
